﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    public enum NPCType
    {

        Task,   //任务类型
        Shop,   //商贩类型
        Iron    //铁匠类型
    }


    abstract class NPC
    {
        private string name;
        private NPCType type;

        /// <summary>
        /// 字段name的属性
        /// </summary>
        public string Name
        {
            get { return this.name; }
            set { this.name = value; }
        }

        /// <summary>
        /// 枚举的属性
        /// </summary>
        public NPCType Type
        {
            get { return this.type; }
            set { this.type = value; }
        }

        public NPC() { }//无参构造


        /// <summary>
        /// 有参构造函数
        /// </summary>
        /// <param name="name"></param>
        /// <param name="type"></param>
        public NPC(string name, NPCType type)
        {
            this.name = name;
            this.type = type;
        }

        /// <summary>
        /// 抽象方法
        /// </summary>
        public abstract void Speak();
    }
}
